Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs for union member casing #1719

Merged
merged 4 commits into from
Jan 21, 2025
Merged

Conversation

abuzar08
Copy link
Contributor

@abuzar08 abuzar08 commented Jan 13, 2025

Before this PR

The definitions mentions that "Union names MUST be in PascalCase", however the example given below had the union names in camelCase.

After this PR

==COMMIT_MSG==
==COMMIT_MSG==
The example now has union names in PascalCase, conforming to the aforementioned convention. The docs now mention that the union Names must be in camelCase.

Possible downsides?

@@ -233,8 +233,8 @@ It is common for a generator to also generate a visitor interface for each union
Payload:
package: com.palantir.example
union:
serviceLog: ServiceLog
notAServiceLog: RequestLog
ServiceLog: ServiceLog
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change should be the inverse - the docs above are incorrect, and union names must be lowerCamelCase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack - flipped the inconsistency Correction.

@@ -222,7 +222,7 @@ Definition for a union complex data type.

Field | Type | Description
---------- | ---- | -----------
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in PascalCase.
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in [camelCase](https://developer.mozilla.org/en-US/docs/Glossary/Camel_case).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Union names need to be specifically lowerCamelCase. UpperCamelCase is not supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

@dtobin dtobin changed the title Made union names PascalCase as mentioned they should be Fix docs for union member casing Jan 14, 2025
@@ -222,7 +222,7 @@ Definition for a union complex data type.

Field | Type | Description
---------- | ---- | -----------
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in PascalCase.
union | Map[`string` → [FieldDefinition][] or [ConjureType][]] | **REQUIRED**. A map from union names to type names. If the value of the field is a `string` it MUST be a type name that exists within the Conjure definition. Union names MUST be in [lowerCamelCase](https://www.techtarget.com/whatis/definition/lowerCamelCase).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This website doesn't look authoritative; we should omit the link here. lowerCamelCase is used elsewhere in this repo without reference - I think it's common enough not to cause confusion!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack - done!

@bulldozer-bot bulldozer-bot bot merged commit 19fa749 into master Jan 21, 2025
5 checks passed
@bulldozer-bot bulldozer-bot bot deleted the abuzark/union-names-pascal branch January 21, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants